<?php !defined('DYHB_PATH') && exit; /* DoYouHaoBaby Framework 模板缓存文件 生成时间：2011-05-28 11:24:24  */ ?>
<?php $this->includeChildTemplate( "".APP_PATH."/Tpl/Default/public_header.html" ,"" ,"" ,"" )  ;?>

<script type="text/javascript">
<!--
<?php if(empty( $nId )) :?>
function checkUsername(){

	Dyhb.AjaxSend('<?php echo( G::U('user/checkusername') );?>','ajax=1&user_name='+$('#user_name').val());
}
<?php else: ?>
function resetPassword(){

	Dyhb.AjaxSend('<?php echo( G::U('user/resetpassword') );?>','ajax=1&id=<?php echo( $arrValue['user_id'] ); ?>&password='+$('#resetPassword').val());
}
function update(){

	Dyhb.AjaxSubmit('userAdd','<?php echo( G::U('user/update') );?>');
}
<?php endif; ?>
-->
</script>

   <!-- 标题  -->
   <div class="title"><?php if(empty( $nId )) :?><?php print G::L( "添加用户", null, null ) ; ?><?php else: ?><?php print G::L( "编辑用户", null, null ) ; ?><?php endif; ?> ( <a href="<?php echo( G::U('user/index') );?>"><?php print G::L( "返回用户列表", null, null ) ; ?></a> )</div>

  <!-- 正文 -->
  <div id="content" class="content">

  <?php if(isset( $nId ) && !empty( $nId )) :?>
    <table class="form-table full">
    <tr>
        <th valign="top"><label for="resetPassword"><?php print G::L( "重置密码", null, null ) ; ?>：</label></th>
        <td><input type="text" name="resetPassword" type="password" id="resetPassword" class="field" size="40"  >
            <input type="button" value="<?php print G::L( "重置密码", null, null ) ; ?>" onclick="resetPassword()" class="field">
            <br/><div class="description"><?php print G::L( "修改用户登录密码，请慎重", null, null ) ; ?></div>
        </td>
    </tr>
    </table>
  <?php endif; ?>

     <form action="<?php if(empty( $nId )) :?><?php echo( G::U('user/insert') );?><?php else: ?><?php echo( G::U('user/update') );?><?php endif; ?>" method="post" id="userAdd" name="userAdd" >
      <table class="form-table full">
          <tr>
            <th valign="top"><label for="user_name"><?php print G::L( "用户名", null, null ) ; ?>：</label></th>
            <td><input type="text" name="user_name" id="user_name" class="field" size="40" <?php if(isset( $arrValue )) :?>disabled="true"<?php endif; ?> value="<?php if(isset( $arrValue )) :?><?php echo( $arrValue['user_name'] ); ?><?php endif; ?>"/>
            <?php if(empty( $nId )) :?><input type="button" value="<?php print G::L( "检测帐号", null, null ) ; ?>" onclick="checkUsername()" class="field"><?php endif; ?>
            <br /><div class="description"><?php print G::L( "用户名是用于登录网站的唯一帐号，建议没有特别的事请不要修改", null, null ) ; ?></div>
            <div class="warning"><?php print G::L( "户名只能由数字，下划线，字母组成", null, null ) ; ?></div>
            </td>
          </tr>
          <?php if(!isset( $nId )) :?>
          <tr>
            <th valign="top"><label for="user_password"><?php print G::L( "密码", null, null ) ; ?>：</label></th>
            <td><input type="password" name="user_password" id="user_password" class="field" size="40" />
             <br/><div class="description"><?php print G::L( "密码是用于用户登录系统的必需，进行安全认证", null, null ) ; ?></div>
            </td>
          </tr>
          <?php endif; ?>
          <tr>
            <th valign="top"><label for="user_nikename"><?php print G::L( "昵称", null, null ) ; ?>：</label></th>
            <td><input type="text" name="user_nikename" id="user_nikename" class="field" size="40" value="<?php if(isset( $arrValue )) :?><?php echo( $arrValue['user_nikename'] ); ?><?php endif; ?>"/>
            <br/><div class="description"><?php print G::L( "昵称是相对于用户的一种身份名字，如admin可以给一个\"管理员\"", null, null ) ; ?></div>
            </td>
          </tr>
          <tr>
            <th valign="top"><label for="user_status"><?php print G::L( "状态", null, null ) ; ?>：</label></th>
            <td><SELECT class="field"  name="user_status">
	             <option value="1" <?php if(isset( $arrValue ) && $arrValue['user_status']==1) :?>selected<?php endif; ?>><?php print G::L( "启用", null, null ) ; ?></option>
	             <option value="0" <?php if(!isset( $arrValue ) || ( isset( $arrValue ) && $arrValue['user_status']==0 ) ) :?>selected<?php endif; ?> ><?php print G::L( "禁用", null, null ) ; ?></option>
	           </SELECT>
	           <br/><div class="description"><?php print G::L( "用户帐号状态，开启后才能够使用", null, null ) ; ?></div>
            </td>
          </tr>
          <tr>
            <th valign="top"><label for="user_remark"><?php print G::L( "备注", null, null ) ; ?>：</label></th>
            <td><textarea name="user_remark" id="user_remark" class="field" cols="70" rows="5"><?php if(isset( $arrValue )) :?><?php echo( $arrValue['user_remark'] ); ?><?php endif; ?></textarea>
            <br/><div class="description"><?php print G::L( "用户的一些其它信息可以填在这里", null, null ) ; ?></div>
            </td>
          </tr>

          </table>
          <p class="center"><?php if(!empty( $nId )) :?><input type="hidden" name="ajax" value="1"><?php endif; ?>
          <input type="hidden" name="id" id="id" value="<?php if(!empty( $nId )) :?><?php echo( $nId ); ?><?php endif; ?>"/>
          <input type="<?php if(!empty( $nId )) :?>button<?php else: ?>submit<?php endif; ?>" <?php if(!empty( $nId )) :?>onclick="update()"<?php else: ?>onclick="javascript:{this.disabled=true;document.userAdd.submit();}"<?php endif; ?>  class="button" value="<?php if(!empty( $nId )) :?>  <?php print G::L( "更  新", null, null ) ; ?><?php else: ?>  <?php print G::L( "发  布", null, null ) ; ?><?php endif; ?>  " />
          <input type="reset" class="button" value="  <?php print G::L( "重  置", null, null ) ; ?>  " />
        </p>
        </form>

   </div>
   <!-- end content -->

<?php $this->includeChildTemplate( "".APP_PATH."/Tpl/Default/public_footer.html" ,"" ,"" ,"" )  ;?>